<div class="blade-content ng-scope" id="blade-content">
  <div class="blade-inner">
    <div class="inner-block">
      <form name="form" class="form" (submit)="onCreate()" [formGroup]="formGroup" novalidate>
        <div class="blade-static __bottom" *ngIf="currentBlade.isNew">
          <button class="btn" [disabled]="!formGroup.valid">创建</button>
        </div>
        <div class="tag-bottom">
          <!--<div class="form-group" formGroupName="validGroup">-->
          <div class="form-group">
            <label class="form-label">线路名称</label>
            <div class="form-input">
              <input placeholder="输入线路名称" name="circuitName" formControlName="circuitName">
            </div>
            <div *ngIf="formErrors.circuitName" class="form-error">
              {{ formErrors.circuitName}}
            </div>
          </div>
          <div class="form-group">
            <label class="form-label">线路编码</label>
            <div class="form-input">
              <input placeholder="输入线路编码" name="circuitCode" formControlName="circuitCode">
            </div>
            <div *ngIf="formErrors.circuitCode" class="form-error">
              {{ formErrors.circuitCode }}
            </div>
          </div>
          <div class="form-group">
            <label class="form-label">所属风场</label>
            <div class="form-input">
                <select (ngModelChange)="onChange($event)" name="farmId" formControlName="farmId">
                <option [value]="f.farmId" *ngFor="let f of farms">
                  {{f.farmName}}
                </option>               
              </select>
            </div>
            <div *ngIf="formErrors.farmId" class="form-error">
              {{ formErrors.farmId }}
            </div>
          </div>
          <!--</div> -->     
       
          <div class="form-group">
            <label class="form-label">所属工期</label>
            <div class="form-control __checkbox">
              <label class="form-label" *ngFor="let p of farmPhases">
                <!--<input [value]="p.phaseId" type="checkbox" name="phaseIds"  formControlName="phaseIds">-->
                <input type="checkbox" [checked]="p.isChecked" (click)="phaseIsChecked($event.target.checked , p)">
                <span class="check" ></span>
                <span class="name">{{ p.phaseName }}</span>
              </label>
            </div>
            <input type="hidden" name="phaseIds" formControlName="phaseIds">
            <div *ngIf="formErrors.phaseIds" class="form-error">
              {{ formErrors.phaseIds }}
            </div>
          </div>
          <div class="form-group">
            <label class="form-label">线路长度(km)</label>
            <div class="form-input">
              <input placeholder="输入线路长度" name="circuitLength" formControlName="circuitLength">
            </div>
            <div *ngIf="formErrors.circuitLength" class="form-error">
              {{ formErrors.circuitLength }}
            </div>
          </div>
          <div class="columns">
            <div class="form-group column">
              <label class="form-label">颜色</label>
              <div class="form-input">
                <input [value]="circuitColorInput.value" placeholder="输入线路颜色值" #circuitColorInput2 formControlName="circuitColor" name="circuitColor">
              </div>
              <div *ngIf="formErrors.circuitColor" class="form-error">
                {{ formErrors.circuitColor }}
              </div>
            </div>
            <div class="form-group column">
              <label class="form-label">颜色选择</label>
              <div class="form-input">
                <input name="circuitColor" #circuitColorInput formControlName="circuitColor" type="color" [value]="circuitColorInput2.value | colorConversion">
              </div>
              <div *ngIf="formErrors.circuitColor" class="form-error transparent" >
                {{ formErrors.circuitColor }}
              </div>
            </div>
          </div>
          <div class="form-group">
            <label class="form-label">排序</label>
            <div class="form-input">
              <input name="circuitSeq" formControlName="circuitSeq" placeholder="输入排序">
            </div>
            <div *ngIf="formErrors.circuitSeq" class="form-error">
              {{ formErrors.circuitSeq }}
            </div>
          </div>
        </div>
      </form>
    </div>
  </div>
</div>